import request from '@/utils/request'

// 查看供应商类型
export function listType(query) {
  return request({
    url: '/admin/supplier/type/',
    method: 'get',
    params: query
  })
}

// 添加供应商类型
export function addType(data) {
  return request({
    url: '/admin/supplier/type/',
    method: 'post',
    data: data
  })
}

// 修改供应商类型
export function updateType(data) {
    return request({
        url: `/admin/supplier/type/${data.id}/`,
        method: 'put',
        data: data
      })
}


// 删除供应商
export function delType(query) {
  return request({
    url: `/admin/supplier/type/${query}/`,
    method: 'delete',
  })
}

// 查看供应商
export function listName(query) {
  return request({
    url: '/admin/supplier/name/',
    method: 'get',
    params: query
  })
}

// 添加供应商
export function addName(data) {
  return request({
    url: '/admin/supplier/name/',
    method: 'post',
    data: data
  })
}

// 修改供应商
export function updateName(data) {
    return request({
        url: `/admin/supplier/name/${data.id}/`,
        method: 'put',
        data: data
      })
}


// 删除供应商
export function delName(query) {
  return request({
    url: `/admin/supplier/name/${query}/`,
    method: 'delete',
  })
}